﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ProjetSMA
{
    class WorldController
    {
        private WorldModel myModel;
        private WorldView2D myView2D;
        private WorldView3D myView3D;

        public WorldController()
        {
            myModel = null;
        }

        public WorldController( WorldModel model)
        {
            myModel = model;
        }

        public void displayViewsForm(Form form)
        {
            Button myButton2D = new Button();
            Button myButton3D = new Button();

            myButton2D.Text = "Simulation 2D";
            myButton2D.Location = new System.Drawing.Point(20, 20);
            myButton2D.Size = new System.Drawing.Size(101, 50);

            EventHandler myHandler = new EventHandler(myButton_Click_2D);
            myButton2D.Click += myHandler;

            form.Controls.Add(myButton2D);

            myButton3D.Text = "Simulation 3D";
            myButton3D.Location = new System.Drawing.Point(20, 100);
            myButton3D.Size = new System.Drawing.Size(101, 50);

            EventHandler myHandler3D = new EventHandler(myButton_Click_3D);
            myButton3D.Click += myHandler3D;

            form.Controls.Add(myButton3D);
        }

        void myButton_Click_2D(Object sender, System.EventArgs e)
        {
         //   MessageBox.Show("Click2D");
            myView2D = new WorldView2D(myModel);
        }

        void myButton_Click_3D(Object sender, System.EventArgs e)
        {
         //   MessageBox.Show("Click3D");
            myView3D = new WorldView3D(myModel);
        }
    }
}
